<?php

    include_once("config.php");

    ob_start();
    include_once(INCLUDE_DIR. "/JavaScript.php");
    include_once(INCLUDE_DIR. "/Coreteam.php");
    ob_clean();

    $name = !empty($_REQUEST["name"]) ? trim($_REQUEST["name"]) : "" ;
    $fileList = !empty($_REQUEST["fileList"]) ? trim($_REQUEST["fileList"]) : "" ;
    $position = !empty($_REQUEST["position"]) ? trim($_REQUEST["position"]) : "" ;


    $myMySQL = new MySQL();
    $myMySQL->connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);

    $myCoreteam = new Coreteam($myMySQL);

    $dataArray = array();
    $dataArray['name']     = $name;
    $dataArray['add_time'] = 'now()';
    $dataArray['pic']      = $fileList;
    $dataArray['position'] = $position;

    $myCoreteam->addRow($dataArray);

    Output::succ('添加成功！', array());

?>